import type { PageQry } from "./common";
import type { MachineDTO } from "./machine";
export enum TunnelType {
  /**
   * 本地端口转发
   */
  LOCAL = 1,
  /**
   * 远程端口转发
   */
  REMOTE = 2,
  /**
   * 动态端口转发
   */
  DYNAMIC = 3
}

export class MachineTunnelPageQry implements PageQry {
  size: number = 10; // 默认值为 10
  current: number = 1; // 默认值为 1
  machineId?: string;
  nameLike?: string;
  type?: TunnelType;
}

export interface MachineTunnelDTO {
  id: string;
  name: string;
  type: TunnelType;
  localPort: number;
  remotePort?: number;
  remoteIp?: string;
  localIp: string;
  start?: boolean;
  machineId: string;
  machineName: string;
}

export class MachineTunnelSaveCmd {
  id?: string;
  machineId: string = "";
  name: string = "";
  type: TunnelType = TunnelType.LOCAL;
  localPort?: number;
  remotePort?: number;
  remoteIp?: string = "0.0.0.0";
  localIp?: string = "0.0.0.0";
}
